// Copyright 2013 Google Inc. All Rights Reserved.

#include <errno.h>

#include <irt_syscalls.h>
#include <nacl/nacl_dyncode.h>

int nacl_list_mappings(struct NaClMemMappingInfo *regions,
                       size_t count, size_t *result_count) {
  if (NULL == __nacl_irt_list_mappings) {
    errno = ENOSYS;
    return -1;
  }
  int retval = __nacl_irt_list_mappings(regions, count, result_count);
  if (retval) {
    errno = -retval;
    return -1;
  }
  return 0;
}
